<template>
  <div>
    <div>
      <div>
        <van-nav-bar
          title="审核新闻"
          left-text="返回"
          left-arrow
          @click-left="onClickLeft"
        />
      </div>
    </div>
    <!--  --> <br>
    <h1>{{name}}</h1><br><br>
    <div>
        <el-button @click="errorNews" type="danger">未通过审核</el-button>
        <el-button @click="successNews" type="primary">通过审核</el-button>
    </div>
    <!--  -->
    <div></div>
    <!--  -->
    <div></div>
    <!--  -->
    <div></div>
    <!--  -->
    <div></div>
    <!--  -->
  </div>
</template>

<script>
export default {
  name: "",
  data() {
    return {
        integral_list: [],
        id: this.$route.query.id,
        name: this.$route.query.name,
        status: 0,
    };
  },
  props: {},

  components: {},

  created() {},

  mounted() {},

  methods: {
    onClickLeft(){
        this.$router.push('/')
    },
    // 进行审核
    news_integrol(){
        this.axios.post('/integral', {status: this.status, news_id: this.id})
        .then(res =>{
            console.log('>>>', res)
            this.$message({
                type: 'success',
                message: res.data.message
            })
            this.onClickLeft()
        }).catch(err =>{
            console.log(err)
        })
    },
    successNews(){
        this.status = 1
        this.news_integrol();
    },
    errorNews(){
        this.status = 2
        this.news_integrol();
    },
  },

  computed: {},

  watch: {},

  directives: {},

  filters: {},
};
</script>

<style scoped>
* {
  margin: 0;
}
.top2{
    display: flex;
    justify-content:space-between;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: 6px;
    margin-top: 10px;
}

</style>
